from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    # XPATH定位
    def sou(self):
        loc=(By.XPATH,'//android.widget.ViewSwitcher[@resource-id="com.achievo.vipshop:id/index_search_custom_hint"]/android.widget.RelativeLayout')
        ele=self.find_ele(loc)
        return ele
    # CLASS_NAME定位
    def sou2(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele = self.find_ele(loc)
        return ele
    # ID定位
    def sou3(self):
        loc=(By.ID,'com.achievo.vipshop:id/tv_search')
        ele = self.find_ele(loc)
        return ele
    # ANDROID_UIAUTOMATOR定位
    def dianji(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("匹克 【软篷篷无扎感】男女围巾条纹披肩高级情侣加厚户外运动保暖围脖")')
        ele = self.find_ele(loc)
        return ele
    # ID定位
    def shoucang(self):
        loc=(By.ID,'com.achievo.vipshop:id/img')
        ele = self.find_ele(loc)
        return ele
    # ID定位
    def fan(self):
        loc = (By.ID, 'com.achievo.vipshop:id/btn_round_back_icon')
        ele = self.find_ele(loc)
        return ele
    # ACCESSIBILITY_ID定位
    def fan2(self):
        loc = (By.ACCESSIBILITY_ID, '返回')
        ele = self.find_ele(loc)
        return ele
    # 断言
    def duan(self):
        loc=(By.ID,'com.achievo.vipshop:id/online_service_title')
        ele=self.find_ele(loc)
        return ele




